dim doc
set doc = application.activedocument

dim cmps,cmp
dim x1,x2,y1,y2,r1,r2,l1,l2
dim cmp1
set cmps = doc.components
for each cmp in cmps
	if cmp.selected = true and cmp.name<>"" then
		'msgbox len(cmp.name)
		cmp.glued = false
		if (cmp1 is nothing) then	
			set cmp1 = cmp
			x1 = cmp.PositionX 
			y1 = cmp.PositionY
			r1= cmp.Orientation
			l1 = cmp.layer
		else
			x2 = cmp.PositionX 
			y2 = cmp.PositionY
			r2= cmp.Orientation
			l2 = cmp.layer

			cmp.Move(x1,y1) 
			cmp.Orientation = r1
			cmp.layer=l1

			cmp1.Move(x2,y2) 
			cmp1.Orientation = r2
			cmp1.layer=l2
			'msgbox cmp1.name & chr(10) & cmp.name
			exit for
		end if
	end if	
next
'msgbox "done!"
